package com.deer.wms.base.system.web;

import com.deer.wms.base.system.model.Carrier;
import com.deer.wms.base.system.model.bill.BillOutMaster;
import com.deer.wms.base.system.model.box.BoxItemCriteria;
import com.deer.wms.base.system.model.box.BoxItemDto;
import com.deer.wms.base.system.model.task.PickTaskCriteria;
import com.deer.wms.base.system.model.task.PickTaskDto;
import com.deer.wms.base.system.service.CarrierService;
import com.deer.wms.base.system.service.InventoryCheckService;
import com.deer.wms.base.system.service.bill.IBillInMasterService;
import com.deer.wms.base.system.service.bill.IBillOutMasterService;
import com.deer.wms.base.system.service.box.IBoxItemService;
import com.deer.wms.base.system.service.task.PickTaskService;
import com.deer.wms.base.system.service.ware.ICellInfoService;
import com.deer.wms.common.core.controller.BaseController;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("main")
public class MainController extends BaseController{
    @Autowired
    private IBillOutMasterService iBillOutMasterService;//出库单据
    @Autowired
    private IBillInMasterService iBillInMasterService;//入库单据
    @Autowired
    private ICellInfoService iCellInfoService;//货位信息
    @Autowired
    private CarrierService carrierService;//载具
    @Autowired
    private InventoryCheckService inventoryCheckService;//盘点
    @Autowired
    private IBoxItemService boxItemService;//物料库存

    @ResponseBody
    @PostMapping("/findMap")
    public  Map<String,Object>mainMap() {
        Map<String,Object> mapMain= new HashMap<>();
        mapMain.put("BillOutMasterCountWeek",iBillOutMasterService.getAllWeek());
        mapMain.put("BillInMasterCountWeek",iBillInMasterService.getBillInMasterWeek());
       //mapMain.put("BillOutCount", iBillOutMasterService.BillOutMasterCount());
       //mapMain.put("BillOutCountByState",iBillOutMasterService.BillOutMasterCountByType());
       //mapMain.put("BillInCount",iBillInMasterService.BillInMasterCount());
       //mapMain.put("BillInCountByState",iBillInMasterService.BillInMasterCountByState());
       mapMain.put("CellInfoCount",iCellInfoService.getCellEmptyCount());
       //mapMain.put("CellInfoCountByState",iCellInfoService.CellInfoCountByState());
       //mapMain.put("BoxItemCount",boxItemService.BoxItemCount());
       //mapMain.put("BoxItemByCountState",boxItemService.BoxItemByCountState());
       //List<Carrier> Carrierlist = carrierService.findAll();
       //mapMain.put("Carrierlist",Carrierlist);
      // mapMain.put("InventoryCheckCountWeek",inventoryCheckService.getInventoryCheckCountWeek());
        return mapMain;
    }

    @ResponseBody
    @PostMapping("/getBoxItemDtoInMain")
    public List<BoxItemDto> getBoxItemDtoInMain(BoxItemCriteria criteria){
        return  boxItemService.getBoxItemDtoInMain(criteria);
    }
}
